<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%@ include file="/WEB-INF/component/commonTagLib.jsp"%>
<!DOCTYPE html>
<html>
<head>
    <title><spring:message code="message.listForm.weiShengJu"/><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.jieSuan.fuShen"/></title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp"%>
    <style type="text/css">
        div.group-info {
            margin-top: 10px !important;
            margin-bottom: 0px !important;
        }
        input.innerInput {
            width: 98%;
        }
        .box-body{
    margin-top:-10px;
    }    	
   </style>
</head>
<body class="skin-blue sidebar-mini fixed skin-blue-light-frame">
    <section class="content-header">
        <h1><spring:message code="message.listForm.weiShengJu"/><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.jieSuan.fuShen"/></h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i><spring:message code="message.lable.first"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.jieSuan.guanLi"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.listForm.weiShengJu"/><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.jieSuan.guanLi"/></a></li>
            <li class="active"><a href="#"><spring:message code="message.listForm.weiShengJu"/><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.jieSuan.fuShen"/></a></li>
        </ol>
     </section>
    
    <section class="content">
       <form id="form" method="post" class="form-horizontal">
        <div class=" box box-success">
            <div class="box-body">
                <div class="input">
                    <div class="textalign1"><spring:message code="message.listForm.weiShengJu"/><spring:message code="message.listForm.mingCheng"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <input type="text" class="textinput" id="heaBurName"  name="heaBurName" placeholder="<spring:message code="message.listForm.weiShengJu"/><spring:message code="message.listForm.mingCheng"/>"/>
                    </div>
                    <div class="textalign"> <spring:message code="message.listForm.suoShuDiQu"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput">
                        <table style="width:100%;">
                           <tr>
                              <td style="width:33%">
                                <select class="textinput" id="area1" name="area1" disabled="disabled">
                            <option value="${area.areaId }">${area.areaName }</option>
                       	   </select>
                       	      </td>
                              <td style="width:33%">   
                                <select class="textinput" id="area2" name="area2" ></select>
                                </td>
                              <td style="width:33%">
                                <select class="textinput" id="area3" name="area3" ></select>
                              </td>
                           </tr> 
                        </table>
                    </div>
                    <div class="textalign"><spring:message code="message.jieSuan.tiJiaoRiQi"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput"> 
                       <table style="width:100%">
                                <tr>
                                    <td style="width:50%">
                                        <input class="textinput" type="text" id="submitStartDatetime"  name="submitStartDatetime" data-provide="datepicker" data-date-fmt="yyyy-MM-dd" placeholder="yyyy-MM-dd" />
                                    </td>
                                    <td>&nbsp;-&nbsp;</td>
                                    <td style="width:50%">
                                        <input class="textinput" type="text" id="submitEndDatetime"  name="submitEndDatetime" data-provide="datepicker" data-date-fmt="yyyy-MM-dd" placeholder="yyyy-MM-dd" />
                                    </td>
                                </tr>
                            </table>
                    </div>
                </div>
                <div class="input" style="margin-top:-5px">
                    <div class="textalign1"> <spring:message code="message.jieSuan.shenHeRiQi"/><spring:message code="message.yanZheng.maoHao"/></div>
                    <div class="boxinput"> 
                       <table style="width:100%">
                                <tr>
                                    <td style="width:50%">
                                        <input class="textinput" type="text" id="auditStartDatetime"  name="auditStartDatetime" data-provide="datepicker" data-date-fmt="yyyy-MM-dd" placeholder="yyyy-MM-dd" />
                                    </td>
                                    <td>&nbsp;-&nbsp;</td>
                                    <td style="width:50%">
                                        <input class="textinput" type="text" id="auditEndDatetime"  name="auditEndDatetime" data-provide="datepicker" data-date-fmt="yyyy-MM-dd" placeholder="yyyy-MM-dd" />
                                    </td>
                                </tr>
                            </table>
                    </div>
                    <div class="textalign" >
                         <button id="selectWSJ" type="button" onclick="gridSerch();" class="btn btn-success btn-sm"><spring:message code="message.button.seachSpacing"/></button>
                    </div>
                </div>
            
              
            </div>
        </div>
        </form>
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>
        
   </section>
    
   <%@ include file="/WEB-INF/component/commonJS.jsp"%>
   <script type="text/javascript">
 //加载页面光标在名字框内，位于第一个
   $("#heaBurName").focus();
 //绑定回车
   $('#heaBurName,#area1,#area2,#area3,#submitStartDatetime,#submitEndDatetime,#auditStartDatetime,#auditEndDatetime').bind('keydown', function(event) {
       if (event.keyCode == "13") {        //13 位电脑上回车键的位置代码
           $('#selectWSJ').click();
       }
   }); 
   
		$(function() {
			$("#gridlist").jqGrid(
					{   url : "toHospSettleReauditList.html",
						mtype : "POST",
						datatype : "json",
						autowidth : true,
                        shrinkToFit: false,
						height : 325,
						colNames : ['<spring:message code="message.jqGrid.cz"/>', 
						            '<spring:message code="message.jieSuan.jieSuanDan"/>id',
						            '<spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.yanZheng.bianMa"/>',
						            '<spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.listForm.mingCheng"/>',
						            '<spring:message code="message.listForm.weiShengJu"/><spring:message code="message.yanZheng.bianMa"/>',
						            '<spring:message code="message.listForm.weiShengJu"/><spring:message code="message.listForm.mingCheng"/>',
						            '<spring:message code="message.listForm.suoShuDiQu"/>',
						            '<spring:message code="message.jieSuan.zongTiaoMuShu"/>',
						            '<spring:message code="message.jieSuan.zongJinE"/>',
						            '<spring:message code="message.jieSuan.tiJiaoRen"/>',
						            '<spring:message code="message.jieSuan.tiJiaoShiJian"/>',
						            '<spring:message code="message.jieSuan.auditPeople"/>',
						            '<spring:message code="message.jieSuan.auditTime"/>'
						            ],
						colModel : [
                                    {name : 'operate',index : 'operate',width : 100,align : "center",sortable:false,
	                                   formatter:function(cellvalue, options, row){
	                                     	var str = "";
		                                    str += "<a href='${ctx}/settlementFirst/toReAuditHospSettleList.html?settlementId="+row.settlementId+"' style='background:url(${ctx}/lib/img/icon/icon.png) no-repeat -180px -60px' class='opIcon' title='<spring:message code="message.jieSuan.fuShen"/>'></a>";
		                                    return str;
                                            	}
                                    },
									{name : 'settlementId',index : 'settlementId', hidden : true,width : 160,align : "center",sortable:false},
									{name : 'settlementCode',index : 'settlementCode', width : 160,align : "center",sortable:false},
									{name : 'settlementName',index : 'settlementName', width : 160,align : "left",sortable:false},
									{name : 'heaBurCode',index : 'heaBurCode', width : 160,align : "center",sortable:false},
									{name : 'heaBurName',index : 'heaBurName', width : 160,align : "left",sortable:false},
									{name : 'areaName',index : 'areaName', width : 100,align : "center",sortable:false},
									{name : 'totalOrders',index : 'totalOrders', width : 80,align : "right",sortable:false},
									{name : 'totalAmount',index : 'totalAmount', width : 100,align : "right",sortable:false},
									{name : 'submitUser',index : 'submitUser', width : 160,align : "left",sortable:false},									
                                    {name : 'submitDatetime',index : 'submitDatetime', width : 160,align : "center",sortable:false,
										formatter:function(cellvalue, options, row){
											if(cellvalue == null){
												cellvalue = ""
												return cellvalue;
											}else{
													return cellvalue;
												}
											}
									
									},
									{name : 'auditUser',index : 'auditUser', width : 160,align : "left",sortable:false},									
									{name : 'auditDatetime',index : 'auditDatetime', width : 160,align : "center",sortable:false,
										formatter:function(cellvalue, options, row){
											if(cellvalue == null){
												cellvalue = ""
												return cellvalue;
											}else{
													return cellvalue;
												}
											}
									
									}
									
						],
						rowNum : 20,
						rowList : [ 10, 20, 50, 100],
						rownumbers : true,
						pager : "#gridpage",
						//multiselect: true, 
						viewrecords : true,
						caption : "<spring:message code="message.listForm.weiShengJu"/><spring:message code="message.jieSuan.jieSuanDan"/><spring:message code="message.listForm.lieBiao"/>",
						//序号宽度自动变化
		                gridComplete:function(){
		                    //序号列宽度自适应（参数为jqgridID）
		                    autoRNWidth("gridlist");
		                    //数据只有一条时默认选中（参数为jqgridID）
		                    selectByOneData("gridlist");
		                },
						jsonReader : {
							repeatitems : false,
							id : "ids"
						}
					});
			$("#gridlist").jqGrid('navGrid', '#gridpage', {add : false,edit : false,del : false,search : false,refresh : false});
			$(window).trigger("resize");
			  /* 所属地区 */
		       $("#area2").HNSelect({
		           parent_selector: "#area1",  url: "${pageContext.request.contextPath}/selectController/getArea.html", dataid: "ID",defaultText: "<option value=''><spring:message code="message.select.option"/></option>",
		           func: function () {
		               $("#area3").HNSelect({
		                   parent_selector: "#area2", url: "${pageContext.request.contextPath}/selectController/getArea.html", dataid: "ID", defaultText: "<option value=''><spring:message code="message.select.option"/></option>",
		               });
		           }
		       }); 
			
		});
			   
	   function gridSerch() {
		   var heaBurName = $.trim($("#heaBurName").val());
		   var area2 = $.trim($("#area2").val());
		   var area3 = $.trim($("#area3").val());
		   var status = $.trim($("#status").val());
		   var submitStartDatetime = $.trim($("#submitStartDatetime").val());
		   var submitEndDatetime = $.trim($("#submitEndDatetime").val());
		   var auditStartDatetime = $.trim($("#auditStartDatetime").val());
		   var auditEndDatetime = $.trim($("#auditEndDatetime").val());
		   
		   $("#gridlist").jqGrid('setGridParam',{  
			   url:"${ctx}/settlementFirst/toHospSettleReauditList.html",
			   datatype:'json',
			   postData:{
				   "heaBurName":heaBurName,
				   "area2":area2,
				   "area3":area3,
				   "status":status,
				   "submitStartDatetime":submitStartDatetime,
				   "submitEndDatetime":submitEndDatetime,
				   "auditStartDatetime":auditStartDatetime,
				   "auditEndDatetime":auditEndDatetime
			   },
			   page:1
		   }).trigger("reloadGrid"); 
	   }
			   
	</script>
</body>
</html>